package mail;

public class Message {
    private String from;
    private String to;
    private String subject;
    private String content;

    public Message(String from, String to, String subject, String content) {
        this.from = from;
        this.to = to;
        this.subject = subject;
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public String getFrom() {
        return from;
    }

    public String getTo() {
        return to;
    }

    public String getSubject() {
        return subject;
    }

    public String getFormattedMesage() {
        return "FROM: <" + this.from + ">" + "\r\n"
                + "TO: <" + this.to + ">" + "\r\n"
                + "SUBJECT: " + this.subject  + "\r\n"
                + "\r\n"
                + this.content.replaceAll("\n", "\r\n")
                + "\r\n"
                + "." + "\r\n";
    }
}